package com.gitee.wsl.data.page

import com.gitee.wsl.lifecycle.nav.Navigation
import com.gitee.wsl.lifecycle.nav.NavigationSource

/**
 * Represents [PagesNavigator] and [NavigationSource] at the same time.
 */
interface PagesNavigation<C : Any> : Navigation<Pages<C>> {

//    class Event<C : Any>(
//        val transformer: (Pages<C>) -> Pages<C>,
//        val onComplete: (newPages: Pages<C>, oldPages: Pages<C>) -> Unit = { _, _ -> },
//    )
}

/**
 * Returns a default implementation of [PagesNavigation].
 * Broadcasts navigation events to all subscribed observers.
 */
fun <C : Any> PagesNavigation(): PagesNavigation<C> =
    DefaultPagesNavigation()
